import { mapGetters } from 'vuex'

export default {
  computed: {
    ...mapGetters(['user', 'userId', 'job', 'org', 'clientId']),
    // 是否为管理员
    isManager() {
      return (
        this.job !== 'org_c_emp' ||
        ['authPerson', 'jury', 'secretary'].some(scope => this.user.scopeArr.includes(scope))
      )
    },
    userParams() {
      const params = {
        'service_id.eq': this.clientId,
      }

      if (!this.isManager) {
        params['orWhere.res_a.eq'] = this.userId
        params['orWhere.res_b.eq'] = this.userId
      }

      return params
    },
  },
}
